using NUnit.Framework;



namespace FineCollection.Cont
{
    [TestFixture]
    public class ArrList_test
    {
        
        [Test]
        public void test_Iterator_Where()
        {
            ArrList<long> list = new ArrList<long>(1,10) {1111, 2222, 3333};
            var it = list.TakeIterator();

            Assert.That(it.Where, Is.EqualTo(-1));
            it.Next(); // 1111
            Assert.That(it.Where, Is.EqualTo(0));
            it.Next(); // 2222
            Assert.That(it.Where, Is.EqualTo(0));
            it.Next(); // 3333
            Assert.That(it.Where, Is.EqualTo(0));
            it.Next(); // behind the end
            Assert.That(it.Where, Is.EqualTo(+1));
        }
        

        [Test]
        public void test_IteratorToTheEnd()
        {
            ArrList<long> list = new ArrList<long>(1,10) {3333, 4444};
            var it = list.TakeIterator();

            it.Next();
            Assert.That(it.Current, Is.EqualTo(3333));
            it.Next();
            Assert.That(it.Current, Is.EqualTo(4444));
            it.Next();
        }
        


    }
}